﻿using Autofac;
using System.Reflection;

namespace Warehouse.Api
{
    public class AutoFacing:Autofac.Module
    {
       protected override void Load(ContainerBuilder builder)
       {
            var list = Assembly.Load("Warehouse.Application");
            builder.RegisterAssemblyTypes(list)
                .Where(x => x.Name.EndsWith("Service"))
                .AsImplementedInterfaces().InstancePerLifetimeScope();


            base.Load(builder);
       }
    }
}
